-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
GH-139946: Colorize error and warning messages in argparse #140695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-139946: Colorize error and warning messages in argparse #140695
Conversation
|
@hugovk would love to get your thoughts here as well. Not sure if not colorizing error/warning keywords was an intentional choice when color was added, but I agree with the user in the issue; the current UX feels a little inconsistent. That said, I could go either way on this. I have removed the backport label, since this is not eligible for backport (it's likely to be a breaking change for some folks). |
hugovk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>


This PR fixes a visual inconsistency in the way that argparse displays error or warning messages with color enabled; the usage line and options are colorized, but the "error:" and "warning:" keywords remain as plain text. This change extends the existing colorization to be consistent across all outputs.
For example:
Before

After
